package com.hzit.security.filter;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.hzit.security.entity.User;
import org.springframework.stereotype.Component;

import javax.servlet.*;
import java.io.IOException;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Component
public class MyFilter implements Filter {
	@Override
	public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
		System.out.println("MyFilter...");
		User user = new ObjectMapper().readValue(servletRequest.getInputStream(), User.class);

		filterChain.doFilter(servletRequest,servletResponse);
	}
}
